﻿#ifndef __KEY_H__
#define __KEY_H__
#ifdef __cplusplus
extern "C" {
    #endif

    #include "main.h"


    #define SW_PORT GPIOB   /*!< key prot */
    #define SW4 GPIO_PIN_15 /*!< sw4 key to ok functiion */
    #define SW5 GPIO_PIN_14 /*!< sw5 key to plus function */
    #define SW6 GPIO_PIN_13 /*!< sw6 key to subtract function */
    #define SW7 GPIO_PIN_12 /*!< sw7 key to select function */


    typedef enum
    {
        KEY_EVENT_4 = 1,
        KEY_EVENT_5 = 1 << 1,
        KEY_EVENT_6 = 1 << 2,
        KEY_EVENT_7 = 1 << 3
    }KeyEvent;


    void key_init(void);

    #ifdef __cplusplus
}
#endif
#endif // KEY_H
